this._draggable.connect('drag-end', this._onDragEnd.bind(this));
this.inDrag = false;
+ const clickAction = new Clutter.ClickAction();
+ clickAction.connect('clicked',
+ () => this.emit('selected', Clutter.get_current_event_time()));
+ this._draggable.addClickAction(clickAction);
+
let iter = win => {
let actor = win.get_compositor_private();
}
}
- vfunc_button_press_event() {
- return Clutter.EVENT_STOP;
- }
-
- vfunc_button_release_event(buttonEvent) {
- this.emit('selected', buttonEvent.time);
-
- return Clutter.EVENT_STOP;
- }
-
- vfunc_touch_event(touchEvent) {
- if (touchEvent.type != Clutter.EventType.TOUCH_END ||
- !global.display.is_pointer_emulating_sequence(touchEvent.sequence))
- return Clutter.EVENT_PROPAGATE;
-
- this.emit('selected', touchEvent.time);
- return Clutter.EVENT_STOP;
- }
-
_onDragBegin(_draggable, _time) {
this.inDrag = true;
this.emit('drag-begin');
this._thumbnails = [];
+ const clickAction = new Clutter.ClickAction();
+ clickAction.connect('clicked', () => {
+ this._activateThumbnailAtPoint(
+ ...clickAction.get_coords(),
+ Clutter.get_current_event_time());
+ });
+ this.add_action(clickAction);
+
Main.overview.connectObject(
'showing', () => this._createThumbnails(),
'hidden', () => this._destroyThumbnails(),
thumbnail.activate(time);
}
- vfunc_button_release_event(buttonEvent) {
- let { x, y } = buttonEvent;
- this._activateThumbnailAtPoint(x, y, buttonEvent.time);
- return Clutter.EVENT_STOP;
- }
-
- vfunc_touch_event(touchEvent) {
- if (touchEvent.type == Clutter.EventType.TOUCH_END &&
- global.display.is_pointer_emulating_sequence(touchEvent.sequence)) {
- let { x, y } = touchEvent;
- this._activateThumbnailAtPoint(x, y, touchEvent.time);
- }
-
- return Clutter.EVENT_STOP;
- }
-
_onDragBegin() {
this._dragCancelled = false;
this._dragMonitor = {